﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace XB.Core.DAO.Audit
{
    public enum EnumAuditAction
    {
        None = 0,

        Update = 2,

        Delete = 3
    }

    public class AuditLog
    {
        public int Id { get; set; }

        public string EditorName { get; set; }

        public int EditorId { get; set; }

        public string MethodName { get; set; }

        public DateTime EditTime { get; set; } = DateTime.Now;

        /// <summary>
        /// 用户操作行为
        /// </summary>
        public EnumAuditAction EnumAuditAction { get; set; }

        /// <summary>
        /// 修改的实体名称，对应表名
        /// </summary>
        public string EntityName { get; set; }

        /// <summary>
        /// 修改实体的主键
        /// </summary>
        public string EntityKeyName { get; set; }

        /// <summary>
        /// 修改实体的主键Value
        /// </summary>
        public string EntityKeyValue { get; set; }
    }

    public class AuditLogItem
    {
        public int Id { get; set; }

        public int AuditLogId { get; set; }

        public string PropertyName { get; set; }

        public string OldValue { get; set; }

        public string NewValue { get; set; }
    }
}
